package io.renren.common.enums;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author sean
 * @since 2020-03-18
 *
 * 通用执行状态
 */
public enum CommonProcessStatus implements IDictEnum<String> {

    /**
     * 待处理
     */
    PENDING("pending", "待处理"),

    /**
     * 处理中
     */
    PROCESSING("processing", "处理中"),

    /**
     * 成功
     */
    SUCCESS("success", "成功"),

    /**
     * 失败
     */
    FAIL("fail", "失败");

    private String code;

    private String description;

    CommonProcessStatus(String code, String description) {
        this.code = code;
        this.description = description;
    }

    @Override
    public String getType() {
        return "PROCESS_TYPE";
    }

    @Override
    public String getDescription() {
        return this.description;
    }

    @Override
    @JsonValue
    public String getValue() {
        return this.code;
    }
}
